package com.wenda.homeschooedu.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import cn.wooshai.core.model.WooshaiGeneratedModel;
import cn.wooshai.core.util.DateUtil;


@MappedSuperclass
public  class BaseModel extends WooshaiGeneratedModel {
	/**
	 * 
	 */
	private static final long serialVersionUID = -8712492200761813775L;
	@Temporal(TemporalType.TIMESTAMP)
	@Column(updatable = false)
	private Date createDate = DateUtil.getCurrentDate();
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(updatable = false)
	@Cache(usage = CacheConcurrencyStrategy.READ_ONLY)
	private Teacher creator;



	public Date getCreateDate() {
		return createDate;
	}



	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}



	public Teacher getCreator() {
		return creator;
	}



	public void setCreator(Teacher creator) {
		this.creator = creator;
	}

}
